const User = require('../../model/user')
const messInfo = require('../messageInfo')
const queryUserById = async (req, res) => {
    try {
        const data = await User.findOne({ _id: req.params.id });
        if (data) {
            res.status(200).json(messInfo(data, 200, '查找成功'))
        } else {
            res.status(200).json(messInfo(data, 200, '查找成功,暂无数据'))
        }
    } catch (error) {
        res.status(400).json(messInfo(null, 400, err.errors))
    }

};
module.exports = queryUserById;